
# Example configuration file for Agito. There are a number of settings
# in this file, many of which can be ignored if they aren't of interest.
# The settings you almost certainly want to edit are those above the
# horizontal line below.

# URL of the Subversion repository.

SVN_REPO = "file:///..."

# Path to directory where the Git repository containing the converted
# history should be stored.

GIT_REPO = "/tmp/gitrepo"

# Subversion paths to convert to Git branches.
# If the paths contain the '%' character, this is a wildcard to map
# from Subversion path to Git branch name. For example:
#   "/releases/foobar-%" : "v%"
# Will result in this mapping:
#   /releases/foobar-0.0.1 -> v0.0.1

BRANCHES = {
	"/trunk" : "master",
	"/branches/%" : "%",
}

# Subversion paths to convert to Git tags.

TAGS = {
	"/tags/%" : "%",
}

# Subversion username to Git author mapping.

AUTHORS = {
	"bobdobbs" : ("Bob Dobbs", "bob@example.com"),
	None : ("Nobody", "nobody@localhost"),
}

# Default author, when not found in the AUTHORS map above. The '%'
# is replaced with the Subversion username.

DEFAULT_AUTHOR = ("%", "%@example.com")

# ---------------------------------------------------------------------------

# If true, tags are created as annotated tag objects, rather than just
# refs to the head of the history of the tag. This is done by taking the
# change at the head of the history, discarding it, and creating a tag
# object in its place, reusing the commit message from the discarded
# commit. This behavior works for most Subversion tags, where the tag
# was created by a 'svn cp' from one path to another. As a sanity check,
# the tree of the head commit is checked to ensure that it matches the
# tree of the parent commit. If it does not, a normal "ref tag" is
# created.

CREATE_TAG_OBJECTS = True

# These lines are always included in the root .gitignore file.

SVN_DEFAULT_IGNORES = """
# These are the default patterns globally ignored by Subversion:
*.o
*.lo
*.la
*.al
.libs
*.so
*.so.[0-9]*
*.a
*.pyc
*.pyo
*.rej
*~
.#*
.*.swp
.DS_store
"""

# Functions to apply to commit messages to convert from Subversion
# commit messages to Git ones.

COMMIT_MESSAGE_FILTERS = [
	agito.reflow_text,         # Reflow text to 72 columns
	agito.append_branch_info,  # Append SVN branch/rev info.
#	agito.rewrite_commit_refs, # Rewrite rDDD or [DDD] SVN commit refs to Git SHA1 hashes
]

# Whether agito.reflow_text should attempt to reflow text on first line of
# commit message.
# Having this False would leave first line of commit message untouched but
# still reflow rest of the lines.
REFLOW_FIRST_LINE = True

# List of revision numbers of Subversion revisions that should be
# "filtered" from the converted history: any changes made in a filtered
# revision will be included in the following revision instead. If you
# filter a commit that is the head of a branch, you're going to have a
# bad time.

FILTER_REVISIONS = []

# Callback function to invoke before creating each commit. This is
# similar to Git's 'filter-branch' command. Invoked with the branch
# path, log entry metadata dictionary, and Directory object representing
# the tree.
#
# The metadata dictionary contains the data used in constructing the Git
# commit - the keys are the same names as the environment variables set
# by 'git filter-branch'.

#def my_filter_callback(path, entry, metadata, treedir):
#	pass

FILTER_BRANCH_CALLBACKS = [
#    my_filter_callback,
]

# Subversion properties used for tracking merges. This maps from a
# property name to a callback function to invoke when the property with
# that value is changed on the root of a branch. The function returns a
# tuple containing the Subversion path of the branch that was merged,
# and the revision number of the point on the branch that was merged.

#def my_merge_callback(path, entry, changed):
#	old_value, new_value = changed
#	...
#	return ("/branches/foo-branch", 1234)

MERGE_CALLBACKS = {

}

# vim: set ft=python:
